package com.itmentu.controller;

import com.itmentu.pojo.UserInfo;
import com.itmentu.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author：http://www.itmentu.com
 * @date： 2021/12/5 19:06
 * @Description：
 ***/
@RestController
@RequestMapping(value = "/user")
public class UserController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     * 查询所遇
     */
    @GetMapping
    public List<UserInfo> findAll(){
        return userInfoService.findAll();
    }

    /**
     * 添加
     */
    @PutMapping
    public int update(@RequestBody UserInfo userInfo){
        return userInfoService.update(userInfo);
    }
}
